package com.ruoyi.im.mongo.domain.qo;

import com.ruoyi.common.mongo.domain.qo.MongoBaseQO;
import com.ruoyi.im.mongo.domain.po.ImMongoMessagePO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.bson.types.ObjectId;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Field;

@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@Data
@SuperBuilder
public class ImMongoMessageQO extends MongoBaseQO<ImMongoMessagePO> {
    private String content;
    private ObjectId _id;
    private String num;
    @Field("translate_content")
    private String translateContent;
    private Boolean system;
    private Boolean saved;
    private Boolean distributed;
    private Boolean seen;
    private Boolean edited;
    private Boolean deleted;
    private Boolean failure;
    private Boolean disableActions;
    private Boolean disableReactions;
    /**
     * 聊天标识，如果是
     */
    private String flag;
    /**
     * 消息状态.1.已发送，2.已读。3.撤回
     */
    @Indexed
    private Integer status;
    @Indexed
    @Field("chat_list_id")
    private ObjectId chatListId;

    private ObjectId roomId;
    /**
     * 1.文本，2。图片，3。表情
     */
    private Integer type;
    /**
     * 1.单聊，2。群聊
     */
    @Field("send_type")
    private Integer sendType;
    /**
     * 群聊ID
     */
    @Field("member_id")
    private ObjectId memberId;


    @Field("read_date")
    private String readDate;

    @Indexed
    @Field("from_user_id")
    private Long formUserId;

    /**
     * 如果是单聊则不为空
     */
    @Indexed
    @Field("to_user_id")
    private Long toUserId;

    private String indexId;
    private String senderId;
    private String username;
    private String avatar;
    private String date;
    private String timestamp;
}
